

<%@ page import="intercampi.Pesquisador" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'pesquisador.label', default: 'Pesquisador')}" />
        <title><g:message code="default.create.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.create.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${pesquisadorInstance}">
            <div class="errors">
                <g:renderErrors bean="${pesquisadorInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" >
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="pessoa"><g:message code="pesquisador.pessoa.label" default="Pessoa" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pesquisadorInstance, field: 'pessoa', 'errors')}">
                                    <g:select name="pessoa.id" from="${intercampi.Pessoa.list()}" optionKey="id" value="${pesquisadorInstance?.pessoa?.id}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="especialidade"><g:message code="pesquisador.especialidade.label" default="Especialidade" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pesquisadorInstance, field: 'especialidade', 'errors')}">
                                    <g:textField name="especialidade" value="${pesquisadorInstance?.especialidade}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="pesquisas"><g:message code="pesquisador.pesquisas.label" default="Pesquisas" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pesquisadorInstance, field: 'pesquisas', 'errors')}">
									<ul>
									<g:each in="${pesquisadorInstance?.pesquisas?}" var="p">
									    <li><g:link controller="pesquisa" action="show" id="${p.id}">${p?.encodeAsHTML()}</g:link></li>
									</g:each>
									</ul>
									<g:link controller="pesquisa" action="create" params="['pesquisador.id': pesquisadorInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'pesquisa.label', default: 'Pesquisa')])}</g:link>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="producoesCientificas"><g:message code="pesquisador.producoesCientificas.label" default="Producoes Cientificas" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pesquisadorInstance, field: 'producoesCientificas', 'errors')}">
									<ul>
									<g:each in="${pesquisadorInstance?.producoesCientificas?}" var="p">
									    <li><g:link controller="producaoCientifica" action="show" id="${p.id}">${p?.encodeAsHTML()}</g:link></li>
									</g:each>
									</ul>
									<g:link controller="producaoCientifica" action="create" params="['pesquisador.id': pesquisadorInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'producaoCientifica.label', default: 'ProducaoCientifica')])}</g:link>
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
